home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group98a.txt / 000133_icon-group-sender _Fri Mar 13 16:34:07 1998.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Return-Path: <icon-group-sender>
  2. Received: from kingfisher.CS.Arizona.EDU (kingfisher.CS.Arizona.EDU [192.12.69.239])
  3.     by baskerville.CS.Arizona.EDU (8.8.7/8.8.7) with SMTP id QAA08003
  4.     for <icon-group-addresses@baskerville.CS.Arizona.EDU>; Fri, 13 Mar 1998 16:34:07 -0700 (MST)
  5. Received: by kingfisher.CS.Arizona.EDU (5.65v4.0/1.1.8.2/08Nov94-0446PM)
  6.     id AA17167; Fri, 13 Mar 1998 16:34:06 -0700
  7. Message-Id: <3509AE03.729A@gte.net>
  8. Date: Fri, 13 Mar 1998 16:06:59 -0600
  9. From: Mark Evans <evans@gte.net>
  10. Reply-To: evans@gte.net
  11. Organization: None
  12. X-Mailer: Mozilla 3.01 (Win95; I)
  13. Mime-Version: 1.0
  14. To: icon-group@optima.CS.Arizona.EDU
  15. Subject: Re: Letter Probabilities
  16. References: <199803131730.LAA18482@axp.cmpu.net>
  17. Content-Type: text/plain; charset=us-ascii
  18. Content-Transfer-Encoding: 7bit
  19. Errors-To: icon-group-errors@optima.CS.Arizona.EDU
  20. Status: RO
  21. Content-Length: 3475
  22.  
  23. To the group -
  24.  
  25. Several people have simultaneously suggested the generator string idea. 
  26. This was the first idea that came to mind when I faced the problem
  27. originally.  See my answer to eka@corp.cirrus.com (Eka Laiman) for my
  28. comments.
  29.  
  30. The probability table is simply a requirement for output.  As long as
  31. I'm going to compute it anyway, it's useful.  When you generate random
  32. text without computing it, there is no way to tell from the output what
  33. are relative probabilities except by very, very gross estimation.  The
  34. table tells you in a glance, top to bottom.
  35.  
  36. In English, the space character is always first, followed by lower case
  37. 'e' with probability about 0.10.  Some results are counterintuitive,
  38. such as 'y' happening 50% more often than 'b' in the sample below
  39. (computed from a small portion of "Moby Dick").
  40.  
  41. I have only been at Icon for a few weeks and think I have a firm grasp
  42. of it.  I don't have any "C mentality" problems.  If I did, then I would
  43. not have bothered asking the group if there were a more elegant Icon
  44. method.  I would certainly not have asked for an Icon-->C converter! 
  45. I've used a number of different languages and know how to adapt.
  46.  
  47. Actually my little program has grown into a moderately complicated Icon
  48. case study.  I've bumped against the 32K limit, that's for sure.  It has
  49. buttons, menus, all kinds of things going on.
  50.  
  51. No one has really answered my original question about the inner while
  52. loop.  Whether it is ideal for this problem or not, I would like to know
  53. whether Icon has some elegant mechanism for scanning such an ordered
  54. list.
  55.  
  56. I will append a sample table for everyone's curiosity.
  57.  
  58. Mark
  59.  
  60. __________________________________________________
  61.  
  62. [letter frequencies]
  63. " "<--->0.1751922190691018
  64. "e"<--->0.09672803124014646
  65. "t"<--->0.07254602343010987
  66. "o"<--->0.06209221664362462
  67. "a"<--->0.06182541415023404
  68. "s"<--->0.05256009119794318
  69. "n"<--->0.05175968371777146
  70. "i"<--->0.0484610347085789
  71. "h"<--->0.04632661476145431
  72. "r"<--->0.04501685706662785
  73. "l"<--->0.0317980062577312
  74. "d"<--->0.03043973901865191
  75. "u"<--->0.02127143515486672
  76. "m"<--->0.01979189405515535
  77. "g"<--->0.01763321933590433
  78. "c"<--->0.01717237866550243
  79. "f"<--->0.01707535957699677
  80. "w"<--->0.01554730893303257
  81. "y"<--->0.01554730893303257
  82. "p"<--->0.0151349778068835
  83. ","<--->0.0151349778068835
  84. "\n"<--->0.010089985204589
  85. "b"<--->0.009968711343956922
  86. "v"<--->0.007397705498556839
  87. "."<--->0.006306240752868125
  88. "-"<--->0.00616071212010963
  89. "k"<--->0.005821145310339808
  90. "I"<--->0.004826699653156758
  91. ";"<--->0.001843362681607606
  92. "T"<--->0.001503795871837784
  93. "?"<--->0.00140677678333212
  94. "B"<--->0.001309757694826457
  95. "W"<--->0.001309757694826457
  96. "S"<--->0.001091464745688714
  97. "N"<--->0.001042955201435882
  98. "A"<--->0.0009701908850566347
  99. "C"<--->0.000921681340803803
  100. "x"<--->0.0008974265686773871
  101. "z"<--->0.0008246622522981394
  102. "j"<--->0.0007033883916660602
  103. "q"<--->0.0006548788474132285
  104. "!"<--->0.0006306240752868126
  105. "P"<--->0.0006306240752868126
  106. "'"<--->0.0006063693031603967
  107. "H"<--->0.0005093502146547332
  108. "F"<--->0.0004850954425283173
  109. "L"<--->0.0004365858982754856
  110. "M"<--->0.0004123311261490697
  111. "D"<--->0.000363821581896238
  112. "E"<--->0.0003395668097698222
  113. "G"<--->0.0003153120376434063
  114. "R"<--->0.0002910572655169904
  115. "Y"<--->0.0001940381770113269
  116. "O"<--->0.0001455286327584952
  117. ")"<--->9.701908850566347e-5
  118. ":"<--->9.701908850566347e-5
  119. "("<--->9.701908850566347e-5
  120. "J"<--->9.701908850566347e-5
  121. "V"<--->4.850954425283173e-5
  122. "U"<--->4.850954425283173e-5
  123. "Q"<--->4.850954425283173e-5
  124.  
  125.